<template>
	<view class="gif-pic">
		<image :src="'http://yihao.cdn.gd-zjgj.com/' + gif_pic" mode="widthFix" lazy-load></image>
	</view>
</template>

<script>
	import request from '@/util/request.js'
	export default {
		name: "GifPic",
		data() {
			return {
				gif_pic: ''
			};
		},
		created() {
			this.requestGifPic()
		},
		methods: {
			// 请求动态图片数据
			requestGifPic() {
				request.globalRequest({
					url: '/api/public/banner_list',
					data: {
						position: 'home_ban'
					}
				}).then(res => {
					this.gif_pic = res[0].bannerImage
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.gif-pic {
		padding: 0 10rpx;
		margin-top: 40rpx;

		image {
			width: 100%;
		}
	}
</style>
